test: Phase 3 — add sub-package tests for api/models (94.6%) and api/types (60.3%)#26
Open
AWaterColorPen wants to merge 1 commit into
Open
test: Phase 3 — add sub-package tests for api/models (94.6%) and api/types (60.3%)#26AWaterColorPen wants to merge 1 commit into
AWaterColorPen wants to merge 1 commit into
Conversation
…types (60.3%) - api/models/schema_test.go: 21 tests covering Graph.GetTree, DataSet, JoinPair, DimensionJoins, MergeJoin, DataSource (IsFact/IsDimension/IsValid/ GetDependencyTree/GetGetDependencyKey), DataSources, Dimension, Metric, GetNameFromKey - api/types/filter_test.go: tests for FilterOperatorType.IsTree, Filter.Expression (all operator types), tree AND/OR, error paths, Statement, Alias, valueType auto-detect - api/types/column_test.go: tests for SingleCol (Value/Count/DistinctCount/Sum/IfExpr), ArithmeticCol (Add/Subtract/Multiply/Divide/As), ExpressionCol - api/types/order_test.go: tests for OrderBy.Expression/Statement/Alias - api/types/types_test.go: tests for Dimension, Metric (all metric types), Join.GetJoinType, DataSource.Expression/Alias/Statement, TimeInterval/Query, Result.SetDimensions/AddSource All 3 packages pass: main=82.8%, api/models=94.6%, api/types=60.3%
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive unit tests for the
api/modelsandapi/typessub-packages, which previously had 0% test coverage.Coverage Results
.(main)api/modelsapi/typesFiles Added
api/models/schema_test.go— 21 tests: Graph, DataSet, JoinPair, DimensionJoins, MergeJoin, DataSource, Dimension, Metric, GetNameFromKeyapi/types/filter_test.go— Filter.Expression (all operators), tree AND/OR, error pathsapi/types/column_test.go— SingleCol, ArithmeticCol, ExpressionColapi/types/order_test.go— OrderBy.Expression/Statement/Aliasapi/types/types_test.go— Dimension, Metric (all 10 types), Join, DataSource, TimeInterval/Query, ResultNotes
api/typesremaining uncovered:clause.go(BuildSQL/BuildDB require gorm DB setup — integration tests, out of scope for unit tests)go test ./...Related: Phase 3 sub-package coverage boost (parallel to PR #25 deps upgrade)